//
//  YLATalkImageViewController.swift
//  Your Lover AI
//
//  Created by 阿忠 on 2024/7/8.
//

import Foundation
import UIKit
import Alamofire
import CryptoKit
import SCrypto
import SwiftyJSON
import SDWebImage
import CryptoSwift
import PopupDialog


class YLATalkImageViewController: UIViewController{
    
    var roleCoverUrl: String!//机器人图片

    
    lazy var backBtn: UIButton = {
        let button = UIButton(type: .custom)
        button.backgroundColor = .clear
        button.setImage(UIImage(named: "icon_left"), for: UIControl.State.normal)
        button.addTarget(self, action: #selector(backClick), for: .touchUpInside)
        return button
    }()
    
    lazy var bgImg: UIImageView = {
        let image = UIImageView(image: UIImage(named: "矩形-1"))
        image.sd_setImage(with: URL(string: self.roleCoverUrl), placeholderImage: UIImage(named: "矩形-1"))
        return image
    }()
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.backgroundColor = UIColor.black
        
        setUI()
        
     
       
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.navigationBar.isHidden = true
        self.tabBarController!.tabBar.isHidden = true
    }
    
    func setUI() {
        view.addSubview(backBtn)
        backBtn.snp.makeConstraints { make in
            make.left.equalTo(16)
            make.top.equalTo(50)
            make.width.height.equalTo(32)
        }
      
        view.addSubview(bgImg)
        bgImg.snp.makeConstraints { make in
            make.left.right.equalToSuperview()
            make.height.equalTo(500)
            make.centerY.equalToSuperview()
        }
      
        
    }
    
   
  
    
    @objc func backClick(){
        
        self.navigationController?.popViewController(animated: true)
    }

    
}
